package com.sc.nft.admin.controller;

import com.sc.nft.admin.request.metamap.MetaMapRequest;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.vo.metamap.MetaMapDividendsVO;
import com.sc.nft.service.MetaMapSettleService;
import com.sc.nft.sup.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/meta/map")
@Api(tags = "后台版权地图模块")
public class AdminMetaMapController {

    private final MetaMapSettleService metaMapSettleService;


    @PostMapping(value = "/pageFundDividends", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "资金分红列表", notes = "资金分红列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<MetaMapDividendsVO> pageFundDividends(@Valid @RequestBody MetaMapRequest request) {
        return PageResult.success(metaMapSettleService.pageFundDividends(request.getPageNo(), request.getPageSize(), request.getDividendsType(), request.getName(), request.getUserTel(), request.getStartTime(), request.getEndTime(), request.getStatus()));
    }

}
